package model;

import java.util.ArrayList;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
public class Device {

    @XmlAttribute
    private String deviceId;
    @XmlElement
    private ArrayList<Teacher> teachers;

    public Device() {

        this.teachers = new ArrayList<Teacher>();
    }

    public Device(String deviceId) {

        this.deviceId = deviceId;

        this.teachers = new ArrayList<Teacher>();
    }

    public String getDeviceId() {

        return this.deviceId;
    }

    public int getTeacherCount() {

        return this.teachers.size();
    }

    public Teacher getTeacherAt(int index) {

        return this.teachers.get(index);
    }

    public void addTeacher(Teacher teacher) {

        this.teachers.add(teacher);
    }
}
